Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add allow-list support to resolve and rpmtree #3

Closed
wants to merge 2 commits into from

Conversation

kellyma2
Copy link
Collaborator

@kellyma2 kellyma2 commented Jan 2, 2025

In addition to allowing a set of packages that are not allowed, we should allow the scope to be narrowed to a set of packages that is allowed. This change adds the --only-allow option to both resolve and rpmtree commands to achieve this outcome.

In addition to allowing a set of packages that are not allowed, we
should allow the scope to be narrowed to a set of packages that is
allowed.  This change adds the `--only-allow` option to both `resolve`
and `rpmtree` commands to achieve this outcome.
@wade-arista wade-arista self-requested a review January 3, 2025 00:40
cmd/resolve.go Outdated Show resolved Hide resolved
pkg/sat/sat.go Outdated Show resolved Hide resolved
pkg/sat/sat.go Outdated Show resolved Hide resolved
pkg/sat/sat.go Outdated Show resolved Hide resolved
@@ -1229,7 +1229,7 @@ func Test(t *testing.T) {
for i, _ := range repo.Packages {
packages = append(packages, &repo.Packages[i])
}
err = resolver.LoadInvolvedPackages(packages, nil)
err = resolver.LoadInvolvedPackages(packages, nil, nil)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test case where it's not nil?

This change tweaks a few bits in the earlier changes to make things a
little nicer:

* clean up the flag help

* fixes the comments for LoadInvolvedPackages

* abort the allowed matcher loop early if we get a match

* re-works the allow/ignore code structure to reduce duplication
pkg/sat/sat.go Show resolved Hide resolved
@kellyma2 kellyma2 closed this Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants